<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Dingo.sensor.Sensor</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="Dingo-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/dingo-wsn/">Dingo</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="Dingo-module.html">Package&nbsp;Dingo</a> ::
        <a href="Dingo.sensor-module.html">Module&nbsp;sensor</a> ::
        Class&nbsp;Sensor
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="Dingo.sensor.Sensor-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Sensor</h1><br /><br />
<center>
<center>  <map id="uml_class_diagram_for_dingo_se" name="uml_class_diagram_for_dingo_se">
<area shape="rect" href="javascript: void(0);" title="threading._Verbose" alt="" coords="172,11,287,43"/>
<area shape="rect" href="javascript: void(0);" title="threading.Thread.isDaemon" alt="" coords="147,97,312,116"/>
<area shape="rect" href="javascript: void(0);" title="threading.Thread.isAlive" alt="" coords="147,116,312,135"/>
<area shape="rect" href="javascript: void(0);" title="threading.Thread.getName" alt="" coords="147,135,312,153"/>
<area shape="rect" href="javascript: void(0);" title="threading.Thread.start" alt="" coords="147,153,312,172"/>
<area shape="rect" href="javascript: void(0);" title="threading.Thread.setName" alt="" coords="147,172,312,191"/>
<area shape="rect" href="javascript: void(0);" title="threading.Thread.setDaemon" alt="" coords="147,191,312,209"/>
<area shape="rect" href="javascript: void(0);" title="threading.Thread.join" alt="" coords="147,209,312,228"/>
<area shape="rect" href="javascript: void(0);" title="threading.Thread" alt="" coords="145,72,313,229"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#io_q" title="ivar: Thread&#45;safe queue to hold I/O events within or this sensor" alt="" coords="17,276,441,295"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#recv_q" title="ivar: Thread&#45;safe queue to hold incoming  messages of type Packet" alt="" coords="17,295,441,313"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#hasGUI" title="ivar: True if a GUI is attached and False otherwise." alt="" coords="17,313,441,332"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#send_q" title="ivar: Thread&#45;safe queue to hold outgoing messages of type Packet" alt="" coords="17,332,441,351"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#CLK_DUMMY" title="Used by Dingo.sensor.Sensor.par to fake parallelism" alt="" coords="17,351,441,369"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#__init__" title="Initialise a new Sensor Object." alt="" coords="17,372,441,391"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#poolBC" title="Contributed by Daniel Goldsmith." alt="" coords="17,391,441,409"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#par" title="Execute several method calls at the same time." alt="" coords="17,409,441,428"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#clock" title="Report the current time (as a float)." alt="" coords="17,428,441,447"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#onAttachGUI" title="Dingo.sensor.Sensor.onAttachGUI" alt="" coords="17,447,441,465"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#send" title="Send a message to another Sensor." alt="" coords="17,465,441,484"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#onMove" title="Dingo.sensor.Sensor.onMove" alt="" coords="17,484,441,503"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#run" title="This method is called by the UI when a simulation is run." alt="" coords="17,503,441,521"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#setColour" title="Change the colour of the graphical representation of this sensor." alt="" coords="17,521,441,540"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#broadcast" title="Broadcast messages to all sensors with a given radius." alt="" coords="17,540,441,559"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#testPool" title="Dingo.sensor.Sensor.testPool" alt="" coords="17,559,441,577"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#recv" title="Recv a message from another Sensor, via the transimssion medium." alt="" coords="17,577,441,596"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#createAvatar" title="Dingo.sensor.Sensor.createAvatar" alt="" coords="17,596,441,615"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html#setShape" title="Change the shape of the graphical representation of this sensor." alt="" coords="17,633,441,652"/>
<area shape="rect" href="Dingo.sensor.Sensor&#45;class.html" title="Superclass for sensor implementations." alt="" coords="16,259,443,653"/>
</map>
  <img src="uml_class_diagram_for_dingo_se.gif" alt='' usemap="#uml_class_diagram_for_dingo_se" ismap="ismap" class="graph-without-title" />
</center></center>
<hr />
<p>Superclass for sensor implementations.</p>
  <p>Think of sensors as a blank piece of memory. Each sensor runs in it's 
  own thread and so each named chunk of memory needs to be locked and 
  unlocked whenever it's accessed or modified. Subclasses of Sensor should 
  add whatever attributes are needed to achieve this.</p>
  In a Simulation, each Sensor has a Scheduler with a Task list where 
  each Task has a reference to it's Sensor (so it can read/write to that 
  Sensors memory and call send() and recv() in order to communicate).<br /><br />

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Dingo.sensor.Sensor-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">id</span>,
        <span class="summary-sig-arg">coords</span>,
        <span class="summary-sig-arg">colour</span>,
        <span class="summary-sig-arg">scheduler</span>,
        <span class="summary-sig-arg">ether</span>,
        <span class="summary-sig-arg">size</span>=<span class="summary-sig-default">10</span>,
        <span class="summary-sig-arg">shape</span>=<span class="summary-sig-default">None</span>)</span><br />
      Initialise a new Sensor Object.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Dingo.sensor.Sensor-class.html#debug" class="summary-sig-name">debug</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">message</span>)</span><br />
      Send a debug message to the Debug plugin.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="createAvatar"></a><span class="summary-sig-name">createAvatar</span>(<span class="summary-sig-arg">self</span>)</span></td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="onMove"></a><span class="summary-sig-name">onMove</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">msg</span>)</span></td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="onAttachGUI"></a><span class="summary-sig-name">onAttachGUI</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">msg</span>)</span></td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="onDetachGUI"></a><span class="summary-sig-name">onDetachGUI</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">msg</span>)</span></td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Dingo.sensor.Sensor-class.html#setShape" class="summary-sig-name">setShape</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">newShape</span>=<span class="summary-sig-default">None</span>)</span><br />
      Change the shape of the graphical representation of this 
      sensor.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Dingo.sensor.Sensor-class.html#setColour" class="summary-sig-name">setColour</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">colour</span>)</span><br />
      Change the colour of the graphical representation of this 
      sensor.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">float</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Dingo.sensor.Sensor-class.html#clock" class="summary-sig-name">clock</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Report the current time (as a float).</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Dingo.sensor.Sensor-class.html#send" class="summary-sig-name">send</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">arc_colour</span>)</span><br />
      Send a message to another Sensor.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">object</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Dingo.sensor.Sensor-class.html#recv" class="summary-sig-name">recv</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Recv a message from another Sensor, via the transimssion 
      medium.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Dingo.sensor.Sensor-class.html#broadcast" class="summary-sig-name">broadcast</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">arc_colour</span>,
        <span class="summary-sig-arg">time_sent</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">msg</span>=<span class="summary-sig-default">None</span>)</span><br />
      Broadcast messages to all sensors with a given radius.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="poolBC"></a><span class="summary-sig-name">poolBC</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">arc_colour</span>,
        <span class="summary-sig-arg">time_sent</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">msg</span>=<span class="summary-sig-default">None</span>)</span><br />
      Contributed by Daniel Goldsmith.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Dingo.sensor.Sensor-class.html#multicast" class="summary-sig-name">multicast</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">arc_colour</span>,
        <span class="summary-sig-arg">time_sent</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">msg</span>=<span class="summary-sig-default">None</span>)</span><br />
      Multicast messages to all specified sensors.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="testPool"></a><span class="summary-sig-name">testPool</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">arc_colour</span>)</span></td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Dingo.sensor.Sensor-class.html#par" class="summary-sig-name">par</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">*calls</span>)</span><br />
      Execute several method calls at the same time.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Dingo.sensor.Sensor-class.html#run" class="summary-sig-name">run</a>(<span class="summary-sig-arg">self</span>)</span><br />
      This method is called by the UI when a simulation is run.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Dingo.sensor.Sensor-class.html#__repr__" class="summary-sig-name">__repr__</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Return a formatted string representing the sensor object.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>threading.Thread</code></b>:
      <code>getName</code>,
      <code>isAlive</code>,
      <code>isDaemon</code>,
      <code>join</code>,
      <code>setDaemon</code>,
      <code>setName</code>,
      <code>start</code>
      </p>
    <div class="private">    <p class="indent-wrapped-lines"><b>Inherited from <code>threading.Thread</code></b> (private):
      <code>_set_daemon</code>
      </p></div>
    <div class="private">    <p class="indent-wrapped-lines"><b>Inherited from <code>threading._Verbose</code></b> (private):
      <code>_note</code>
      </p></div>
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__setattr__</code>,
      <code>__str__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Class Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-ClassVariables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="CLK_DUMMY"></a><span class="summary-name">CLK_DUMMY</span> = <code title="'CLK_DUMMY'"><code class="variable-quote">'</code><code class="variable-string">CLK_DUMMY</code><code class="variable-quote">'</code></code><br />
      Used by <code class="link">Dingo.sensor.Sensor.par to fake 
      parallelism</code>
    </td>
  </tr>
</table>
<!-- ==================== INSTANCE VARIABLES ==================== -->
<a name="section-InstanceVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceVariables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="hasGUI"></a><span class="summary-name">hasGUI</span><br />
      ivar: <code>True</code> if a GUI is attached and 
      <code>False</code> otherwise.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="recv_q"></a><span class="summary-name">recv_q</span><br />
      ivar: Thread-safe queue to hold incoming  messages of type 
      Packet
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="send_q"></a><span class="summary-name">send_q</span><br />
      ivar: Thread-safe queue to hold outgoing messages of type 
      Packet
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="io_q"></a><span class="summary-name">io_q</span><br />
      ivar: Thread-safe queue to hold I/O events within or this 
      sensor
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Properties</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Properties"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">id</span>,
        <span class="sig-arg">coords</span>,
        <span class="sig-arg">colour</span>,
        <span class="sig-arg">scheduler</span>,
        <span class="sig-arg">ether</span>,
        <span class="sig-arg">size</span>=<span class="sig-default">10</span>,
        <span class="sig-arg">shape</span>=<span class="sig-default">None</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  <p>Initialise a new Sensor Object.</p>
  This will create a new sensor object in the simulation, each sensor 
  has its own unique ID that is used to identify it within the 
  simulation.
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>coords</code></strong> (tuple) - A tuple (x,y) containing the sensors coordinates on the graph 
          pane</li>
        <li><strong class="pname"><code>colour</code></strong> (Dingo.OGL.SensorColour) - An object denoting the colour initially used to display the 
          sensor in the graph</li>
        <li><strong class="pname"><code>scheduler</code></strong> (Dingo.scheduler.Scheduler) - The scheduler describing the run-time behaviour of the 
          sensor</li>
        <li><strong class="pname"><code>ether</code></strong> (Dingo.simulation.Ether) - A reference to the simulated transmission medium used by this 
          sensor</li>
    </ul></dd>
    <dt>Overrides:
      threading.Thread.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="debug"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">debug</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">message</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Send a debug message to the Debug plugin. See also <a 
  href="Dingo.plugins.debug-module.html" 
  class="link">Dingo.plugins.debug</a>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>message</code></strong> (str) - Text to send to the debug plugin</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="setShape"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">setShape</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">newShape</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Change the shape of the graphical representation of this sensor. 
  Contributed by Daniel Goldsmith.
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>newshape</code></strong> (str) - Shape to represent this sensor.</li>
        <li><strong class="pname"><code>size</code></strong> (int) - size of new shape</li>
    </ul></dd>
  </dl>
<div class="fields">      <p><strong>Precondition:</strong>
        <code>newShape in ['circle', 'square', 'triangle'] or 
        type(newShape) == type([])</code>
      </p>
</div></td></tr></table>
</div>
<a name="setColour"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">setColour</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">colour</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Change the colour of the graphical representation of this sensor.
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>colour</code></strong> (SensorColour) - colour to set the avatar of this sensor</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="clock"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">clock</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Report the current time (as a float). Time is taken from the processor
  and should be accurate to the nearest millisecond. To simulate clock 
  drift; override this method and add a random value to the result of 
  time.clock().
  <dl class="fields">
    <dt>Returns: float</dt>
  </dl>
</td></tr></table>
</div>
<a name="send"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">send</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">arc_colour</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Send a message to another Sensor. This will take whatever messages are
  currently in the sensors send Queue forward them to the sensor 
  specified
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><p><strong class="pname"><code>arc_colour</code></strong> (Dingo.OGL.SensorColour) - colour arc is used on the sensorGraph</p>
          <b>BUG:</b> This method ignores the broadcast range of the 
          radio, messages can therefore be sent further than is possible in
          the medium</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="recv"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">recv</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Recv a message from another Sensor, via the transimssion medium. This 
  will return the top item in the sensors receive queue.
  <dl class="fields">
    <dt>Returns: object</dt>
  </dl>
</td></tr></table>
</div>
<a name="broadcast"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">broadcast</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">arc_colour</span>,
        <span class="sig-arg">time_sent</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">msg</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Broadcast messages to all sensors with a given radius. Broadcast 
  radius is set in api.Ether.RF_radius and is measured in pixels, each of 
  which represents one square centimetre.
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>arc_colour</code></strong> (Dingo.OGL.SensorColour) - Colour of the arc used to represent this broadcast.</li>
        <li><strong class="pname"><code>time_sent</code></strong> (float) - Can be used to change the sending time of the message</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="multicast"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">multicast</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">arc_colour</span>,
        <span class="sig-arg">time_sent</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">msg</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  <p>Multicast messages to all specified sensors. This allows the sensor to
  multicast messages to a list of receivers.  The destination address are 
  taken from the msg.receiver_id field and should be input as a list / 
  tuple.</p>
  <p>Sensors in the receiver list are checked to see if they are in 
  broadcast range.  <a href="Dingo.simulation.Ether-class.html#broadcast" 
  class="link">Dingo.simulation.Ether.broadcast</a>broadcast has a detailed
  explanation of how the range is calculated</p>
  Contributed by Daniel Goldsmith.
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>arc_colour</code></strong> (Dingo.OGL.SensorColour) - What colour arc to draw on the sensorGraph</li>
        <li><strong class="pname"><code>msg</code></strong> (Dingo.packet.Packet) - The message to send this should be a packet object</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="par"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">par</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">*calls</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Execute several method calls at the same time. The argument to par 
  should be a list of (method-object, args-tuple) 2-tuples. If 
  Sensor.CLK_DUMMY appears in any argument list it will be replaced with a 
  timestamp when the method is called.
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="run"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">run</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  This method is called by the UI when a simulation is run. The run 
  method will call the scheduler to see which tasks are to be completed 
  then preform these tasks.
  <dl class="fields">
    <dt>Overrides:
      threading.Thread.run
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="__repr__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">self</span>)</span>
    <br /><em class="fname">(Representation operator)</em>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Return a formatted string representing the sensor object.
  <dl class="fields">
    <dt>Overrides:
      threading.Thread.__repr__
    </dt>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="Dingo-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/dingo-wsn/">Dingo</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    <a href="epydoc-log.html">Generated by Epydoc
    3.0beta1 on Tue Jun  3 00:42:58 2008</a>
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
